<?php

#We load the class definition specefic from the administration area
require_once($server->my_site[0]->path.$server->my_site[0]->folder."classes/user.php");

if (isset($_SESSION[ "ser_distributor" ])) {
	$distributor=unserialize($_SESSION[ "ser_distributor" ]);
	//If the domain sent doesn't match the actual one we log off the user 
	if (!$server->my_site[0]->is_host($distributor->site_domain)) {
		$distributor= new distributor();
		#We load the default data when a new user comes to the site
		$distributor->init_defaults($server->my_site[0]->subdomain . '.' . $server->my_site[0]->domain);
	}
}
else {
	$distributor= new distributor();
		#We load the default data when a new user comes to the site
		$distributor->init_defaults($server->my_site[0]->subdomain . '.' . $server->my_site[0]->domain);
}

#We update the user session with the user data just loaded
$_SESSION["ser_distributor"]=serialize($distributor);

?>